<%@page import="java.util.HashMap"%>
<%@page import="java.util.Map"%>
<%@page import="com.itsm.v17.entity.WorkOrderOpinion"%>
<%@page import="com.itsm.v17.entity.OpinionStatistics"%>
<%@page import="java.util.List"%>
<%@ page pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String startDate =(String)request.getAttribute("startDate");
String endDate =(String)request.getAttribute("endDate");
String message =(String)request.getAttribute("message");
List list =(List)request.getAttribute("list");
Map map=new HashMap();
map.put("weixin", "微信端");
map.put("weixinmessage", "微信消息");
map.put("mobile", "移动端");
map.put("mobilemessage", "短信消息");
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>评价报表</title>
<link href="<%=basePath%>css/home.css" type="text/css" rel="stylesheet" />
<script src="<%=basePath%>js/DatePicker/WdatePicker.js" type="text/javascript"></script>
<link href="<%=basePath%>js/DatePicker/skin/WdatePicker.css" rel="stylesheet" type="text/css">
<style>
.tableblue00 td{
padding:5px;
}
.bbzxbg2:hover{
background:#dadada;
}
.columnHead td{
background:#e7eaed;
}
</style>
<script>
function query()
{
	var startDate=document.getElementById("startDate").value;
	var endDate=document.getElementById("endDate").value;
	location.href="<%=basePath%>itsm17/workorder/opinion/list?startDate="+startDate+"&endDate="+endDate;
}
function exportExcel()
{
	var startDate=document.getElementById("startDate").value;
	var endDate=document.getElementById("endDate").value;
	window.open("<%=basePath%>itsm17/workorder/opinion/exportExcel?startDate="+startDate+"&endDate="+endDate,"_blank");
}
</script>
</head>
<body style="padding:5px;margin:0px;">
	    <table width="100%" cellspacing="1" cellpadding="0" border="0" bgcolor="#D6E6F4" class="tableblue00">
                            <tbody>
                            <tr class="bbzxbg2">
                              <td colspan=3 >
                              	 评价时间(起)： <input type="text" id="startDate" value="<%=startDate%>"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" />
                              	 &nbsp; &nbsp; &nbsp; &nbsp;
                              	 评价时间(止)： <input type="text" id="endDate" value="<%=endDate%>" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" />
                              	 &nbsp; &nbsp; &nbsp; &nbsp;
                              	 
                              	 <a class="actionbutton"  href='javascript:void();' onclick="query()" class="menudiv" style="margin-right: 10px;">查询</a>
                              	 &nbsp;&nbsp;
                              	  <a class="actionbutton"  href='javascript:void();' onclick="exportExcel()" class="menudiv" style="margin-right: 10px;">导出</a>
                              	 &nbsp;&nbsp;
     <%
   	if(list != null)
   	{
   		out.print("查询结果 "+list.size()+" 条");
   	}
   		%>
   	
                              </td>
                            </tr></tbody>
          </table>
                     <br/>
                     
<table width="100%" cellspacing="1" cellpadding="0" border="0" bgcolor="#D6E6F4" class="tableblue00 ry_box">
   <tbody>
   <tr class="columnHead" align="center" >
  			 <td align="left">序号</td>
   				<td align="left">评价时间</td>
                <td width="20%">流程编号</td>
                 <td align="left">用户ID</td>
                <td align="left">工程师评价星级</td>
                <td align="left">服务台评价星级</td>
                <td align="left">来源</td>
                <td align="left">一级部门</td>
                <td align="left">二级部门</td>
                <td align="left">评价内容</td>
         </tr>
   <%
   	if(list != null)
   	{
   		
   		
   		for(int i=0;i<list.size();i++)
   		{
   			WorkOrderOpinion opinion=(WorkOrderOpinion)list.get(i);
   			%>
   				<tr class="bbzxbg2">
   				<td><%=(i+1)%></td>
   				<td align="left"><%=opinion.getDateTime()%></td>
                <td width="20%"><%=opinion.getWorkOrderId()%></td>
                <td align="left"><%=opinion.getUserId()%></td>
                <td align="left"><%=opinion.getGrade()%></td>
                <td align="left"><%=opinion.getServiceGrade()%></td>
                <td align="left"><%
                	if(map.get(opinion.getUserFrom()+"")!=null){out.print(map.get(opinion.getUserFrom()+""));}
                	%>&nbsp;</td>
                <td align="left"><%=opinion.getDepartmentName()%></td>
                <td align="left"><%=opinion.getDepartmentName2()%></td>
                <td align="left"><%=opinion.getContent()%></td>
         </tr>
   			<%
   		}
   		
   	}
   
   %>
          <tr class="bbzxbg2">
                <td colspan=10 align="left">&nbsp;<%=message%></td>
         </tr>               
 </tbody>
</table>            
                     
                     
</body>
</html>